#!/bin/bash

if [ $# -ne 1 ]; then
    echo "$0 <cluster name>"
    exit 1
fi
cluster=$1

# images="zongzw/f5-cni-tool:latest-20231031-135828"
# images="zongzw/f5-cni-tool:latest-20231101-124708"
# images="zongzw/f5-cni-tool:latest-20231101-145428"
# images="zongzw/f5-cni-tool:latest-20231101-152314"
image="zongzw/f5-cni-tool:latest-20231108-210422"
if [[ "$cluster" =~ flannel ]]; then
    images="$images flannel/flannel:v0.22.2 flannel/flannel-cni-plugin:v1.2.0"
fi

if [[ "$cluster" =~ calico ]]; then
    images="$images calico/cni:v3.26.1 calico/node:v3.26.1"
fi

if [[ "$cluster" =~ cilium ]]; then
    images="$images quay.io/cilium/operator-generic:v1.14.3 quay.io/cilium/cilium:v1.14.3"
    #images="$images quay.io/cilium/operator-generic:v1.13.8 quay.io/cilium/cilium:v1.13.8"
    #images="$images quay.io/cilium/operator-generic:v1.12.15 quay.io/cilium/cilium:v1.12.15"
fi

echo loading $images

for n in $images; do 
	echo $n; 
	docker pull $n
done

kind load docker-image --name $cluster-cluster $images
